package Day13;

import java.util.HashMap;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            String str = in.next();
            char[] ch = str.toCharArray();
            HashMap<Character,Integer> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                map.put(ch[i],map.getOrDefault(ch[i],0) + 1);
            }
            int max = 0;
            for (int i = 'a'; i <= 'z'; i++) {
                max = Math.max(max,map.getOrDefault((char)i,0));
            }
            if(n - max < max - 1){
                System.out.println("no");
                continue;
            }else {
                System.out.println("yes");
            }
        }
    }
}
